package com.icez.base_util_library.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter

/**
 * viewpage2 Fragment 适配器
 */
class BaseViewPager2ForFragmentAdapter(
    mFragmentManager: FragmentManager,
    mLifecycle: Lifecycle,
    val mFragmentLists: ArrayList<Fragment>
) : FragmentStateAdapter(mFragmentManager, mLifecycle) {


    override fun getItemCount(): Int {
        return mFragmentLists.size
    }

    override fun createFragment(position: Int): Fragment {
        return mFragmentLists.get(position)
    }
}